#Dockerfile
#制定node镜像的版本
FROM node:18-alpine

#进入到app目录下面，类似cd
WORKDIR /app

#移动当前目录下面的文件到app目录下
ADD . /app/

#安装依赖
RUN npm config set registry https://registry.npmmirror.com/ && \    
    npm i
# RUN apk add --no-cache yarn

# # 设置Yarn的registry并安装依赖
# RUN yarn config set registry https://registry.npmmirror.com/ && \
#     yarn install

RUN npx prisma generate

RUN npm run build

RUN chmod +x startup.sh
#对外暴露的端口
EXPOSE 3000
#程序启动脚本
# CMD ["npm", "start"]
ENTRYPOINT ["sh", "startup.sh"]